// Tags:
#include <algorithm>
#include <cstdio>

typedef long long ll;
const int N = 1e5 + 5, mod = 998244353;
int n, a[N], p[N];
bool flag = true;

inline ll qpow(ll base, int index) {
  ll res = 1;
  while (index) {
    if (index & 1) res = res * base % mod;
    base = base * base % mod;
    index >>= 1;
  }
  return res;
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("A.in", "r", stdin);
  freopen("A.out", "w", stdout);
#endif
#endif

  scanf("%d", &n);
  ll ans(1);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    ans *= a[i];
    if (ans >= mod) ans %= mod;
  }
  printf("%lld", qpow(ans, mod - 2));
  return 0;
}